home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 024 / modula-2 / m2 / amigados.def < prev    next >
Text File  |  1995-03-17  |  5KB  |  157 lines

  1. (********************************************************************************
  2.  
  3. Name         : AMIGADos.DEF
  4. Version      : 1.0
  5. Purpose      : Interface to AMIGADos
  6. Authors      : cn/jr/ms/red
  7. Modified     : 12.3.86  20:26  cn
  8. State        : should be ok
  9. Requirements : 
  10.  
  11. ********************************************************************************)
  12.  
  13. DEFINITION MODULE AMIGADos;
  14.  
  15. FROM SYSTEM IMPORT ADDRESS;
  16.  
  17. TYPE AMIGADateStamp      = RECORD
  18.                              days: LONGINT;    (* nr of days *)
  19.                              minutes: LONGINT; (* nr of minutes this day *)
  20.                              ticks: LONGINT    (* nr of ticks in current minute *)
  21.                            END;
  22.     
  23.      AMIGAFileInfoBlock  = RECORD         (* must be longword-aligned! *)
  24.                              diskKey: LONGINT;                  (*   4 *)
  25.                              dirEntry: LONGINT;                 (*   4 *)
  26.                              fileName: ARRAY [0..107] OF CHAR;  (* 108 *)
  27.                              protection: LONGINT;               (*   4 *)
  28.                              entryType: LONGINT;                (*   4 *)
  29.                              size: LONGINT;                     (*   4 *)
  30.                              blocks: LONGINT;                   (*   4 *)
  31.                              date: AMIGADateStamp;              (*  12 *)
  32.                              comment: ARRAY [0..115] OF CHAR    (* 116 *)
  33.                            END;                        (* TSIZE =  260 *)
  34.  
  35.      AMIGALockPtr;
  36.  
  37.      AMIGAFile;
  38.  
  39.      AMIGAInfoData       = RECORD
  40.                              numSoftErrors,
  41.                              unitNumber,
  42.                              diskState,
  43.                              numBlocks,
  44.                              numBlocksUsed,
  45.                              bytesPerBlock: LONGINT;
  46.                              diskType: RECORD
  47.                                          CASE :BOOLEAN OF
  48.                                          | TRUE: val: LONGINT;
  49.                                          | FALSE: typ: ARRAY [0..3] OF CHAR;
  50.                                          END
  51.                                        END;
  52.                                        (*  val = -1    : no disk present
  53.                                          | typ = 'BAD' : unreadable disk
  54.                                          | typ = 'DOS' : dos disk
  55.                                          | typ = 'NDOS': not really dos
  56.                                          | typ = 'KICK': kickstart disk  *)
  57.                              volumeNode, 
  58.                              inUse: LONGINT
  59.                            END;
  60.  
  61.      AMIGASeekMode       = (ofsBeginning, ofsCurrent, ofsEnd);
  62.                            (* Note: the values must be -1, 0, 1 for AMIGALib *)
  63.  
  64.      AMIGAFileProtection = (deletionProtection, executeProtection,
  65.                             writeProtection, readProtection);
  66.  
  67.      AMIGAFileProtectSET = SET OF AMIGAFileProtection;
  68.                            (* Note: the bits according to the values
  69.                               must be included in mask *)
  70.  
  71.      AMIGAProcessPtr;
  72.  
  73.      AMIGASegmentPtr;
  74.  
  75.  
  76. (* File Handling  *)
  77.  
  78. PROCEDURE Close(f: AMIGAFile);
  79.  
  80. PROCEDURE CreateDir(name: ARRAY OF CHAR): AMIGALockPtr;
  81.  
  82. PROCEDURE CurrentDir(lockPtr: AMIGALockPtr): AMIGALockPtr;
  83.  
  84. PROCEDURE DeleteFile(name: ARRAY OF CHAR; VAR done: BOOLEAN);
  85.  
  86. PROCEDURE DupLock(lockPtr: AMIGALockPtr): AMIGALockPtr;
  87.  
  88. PROCEDURE Examine(lockPtr: AMIGALockPtr;
  89.                   VAR fileInfo: AMIGAFileInfoBlock; VAR done: BOOLEAN);
  90.  
  91. PROCEDURE ExNext(lockPtr: AMIGALockPtr;
  92.                   VAR fileInfo: AMIGAFileInfoBlock; VAR done: BOOLEAN);
  93.  
  94. PROCEDURE Info(lockPtr: AMIGALockPtr;
  95.                VAR infoData: AMIGAInfoData; VAR done: BOOLEAN);
  96.  
  97. PROCEDURE Input(): AMIGAFile;
  98.  
  99. PROCEDURE IoErr(): LONGINT;
  100.  
  101. PROCEDURE IsInteractive(f: AMIGAFile): BOOLEAN;
  102.  
  103. PROCEDURE Lock(name: ARRAY OF CHAR;
  104.                accessWrite: BOOLEAN): AMIGALockPtr;
  105.  
  106. PROCEDURE Open(name: ARRAY OF CHAR; newFile: BOOLEAN): AMIGAFile;
  107.  
  108. PROCEDURE Output(): AMIGAFile;
  109.  
  110. PROCEDURE ParentDir(lockPtr: AMIGALockPtr): AMIGALockPtr;
  111.  
  112. PROCEDURE Read(f: AMIGAFile; buffer: ADDRESS; length: LONGINT): LONGINT;
  113.  
  114. PROCEDURE Rename(oldname, newname: ARRAY OF CHAR; VAR done: BOOLEAN);
  115.  
  116. PROCEDURE Seek(f: AMIGAFile; pos: LONGINT; seekMode: AMIGASeekMode): LONGINT;
  117.  
  118. PROCEDURE SetComment(name, comment: ARRAY OF CHAR; VAR done: BOOLEAN);
  119.  
  120. PROCEDURE SetProtection(name: ARRAY OF CHAR;
  121.                         mask: AMIGAFileProtectSET; VAR done: BOOLEAN);
  122.  
  123. PROCEDURE UnLock(lockPtr: AMIGALockPtr);
  124.  
  125. PROCEDURE WaitForChar(f: AMIGAFile; timeout: LONGINT): BOOLEAN;
  126.  
  127. PROCEDURE Write(f: AMIGAFile; buffer: ADDRESS; length: LONGINT): LONGINT;
  128.  
  129.  
  130. (* Process Handling *)
  131.  
  132. PROCEDURE CreateProc(name: ARRAY OF CHAR; priorty: LONGINT;
  133.                      segment: AMIGASegmentPtr;
  134.                      stackSize: LONGINT): AMIGAProcessPtr;
  135.  
  136. PROCEDURE DateStamp(VAR v: AMIGADateStamp);
  137.  
  138. PROCEDURE Delay(timeout: LONGINT);
  139. (* delay in ticks  --  1 tick = 20 ms *)
  140.  
  141. PROCEDURE DeviceProc(name: ARRAY OF CHAR): AMIGAProcessPtr;
  142.  
  143. PROCEDURE Exit(returnCode: LONGINT);
  144.  
  145.  
  146. (* Loading Code *)
  147.  
  148. PROCEDURE Execute(command: ARRAY OF CHAR;
  149.                   VAR input, output: AMIGAFile; VAR done: BOOLEAN);
  150.  
  151. PROCEDURE LoadSeg(name: ARRAY OF CHAR): AMIGASegmentPtr;
  152.  
  153. PROCEDURE UnLoadSeg(segment: AMIGASegmentPtr);
  154.  
  155.  
  156. END AMIGADos.
  157.